<template>
  <div class="jd-navbar">
    <van-nav-bar :title="title" :left-text="leftText" left-arrow 
     @click-left='back' @click-right='$emit("skip")'
     :right-text='rightText'
    >
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  name: '',
  data() {
    return {
    }
  },

  props: {
    title: { type: String, require: false, default: '' },
    leftText: { type: String, require: false, default: '返回' },
    rightText: { type: String, require: false, default: '登录' }
  },

  methods: {
    back() {
      this.$emit('back')  // 可以支持父组件传递一个字定义方法 back
      this.$router.back()
    }
  }
}
</script>

<style lang="scss" scoped>

</style>